﻿using TrueSync;


namespace HEFramework
{
    public static class StatisticSystem
    {
        [EntitySystem]
        public class StatisticAwakeSystem : AwakeSystem<Statistic>
        {
            protected override void Awake(Statistic _self)
            {
            }
        }


        public static void Statistic(this Statistic _self, TSVector _p, int _aID, int _bID, ePowerType _type, bool _isCTR, bool _isMiss, FP _hp, FP _mp, bool _isShow)
        {
            Statistic.StatisticData data = new Statistic.StatisticData();
            data.Time = TimeRunner.Instance.ClientNow();
            data.Pos = _p;
            data.A_ID = _aID;
            data.B_ID = _bID;
            data.PowerType = _type;
            data.IsCritical = _isCTR;
            data.IsMiss = _isMiss;
            data.HP = _hp;
            data.MP = _mp;
            data.Type = HEFramework.Statistic.eType.Battle;
            data.IsShow = _isShow;
            _self.StatisticDatas.Add(data);
        }

        public static void Statistic(this Statistic _self, string _message)
        {
            Statistic.StatisticData data = new Statistic.StatisticData();
            data.Time = TimeRunner.Instance.ClientNow();
            data.Message = _message;
            data.Type = HEFramework.Statistic.eType.Normal;
            _self.StatisticDatas.Add(data);
        }
    }
}